package com.juno.ui.viewflow;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.juno.cafenoa.R;

public class CafeIntroAdapter extends BaseAdapter {
	
	private LayoutInflater mInflater;
	private static final int[] ids = {R.drawable.introcafe, R.drawable.introcafet};
	
	public CafeIntroAdapter(Context context){
		mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return ids.length;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		//정의된 view에 있는 imageview를 가져옴.
		if(convertView == null){
			convertView = mInflater.inflate(R.layout.flow_item_layout, null);
		}
		((ImageView)convertView.findViewById(R.id.flow_imgView)).setImageResource(ids[position]);
		return convertView;
	}

}
